const isLogin = async (_this) => {
	let userInfo = _this.$store.state.userInfo
	if(userInfo){
		// console.log(1);
		let {token} = userInfo
		let options = {
			url:'/api/checktoken',
			header:{
				authorization:token
			}
		}
		let res = await _this.$http(options)
		// console.log(res);
		if(res.data.code == 200){
			uni.setTabBarItem({
				index:3,
				text:'我的'
			})
			return true
		}else{
			uni.setTabBarItem({
				index:3,
				text:'未登录'
			})
			uni.removeStorageSync('userInfo')
			return false
		}
	}else{
		uni.setTabBarItem({
			index:3,
			text:'未登录'
		})
		return false
	}
}

export default isLogin